﻿class Node extends MovieClip {
	public var lines:Array = new Array();
	
	public function init(px:Number, py:Number):Void {
		_x = px;
		_y = py;
	}
	
	public function addLine(l:MovieClip):Void {
		lines.push(l);
	}
	
	public function onPress():Void {
		startDrag(this);
		
		this.onEnterFrame = function() {
			//x = this._x;
			//y = this._y;
			for (var l in lines) {
				lines[l].update();
			};
		}
		//x = _xmouse;
		//y = _ymouse;
	};
	
	public function onRelease() {
		stopDrag();
		delete this.onEnterFrame ();
		//x = _xmouse;
		//y = _ymouse;
	};
}